//
//  HTDeliverDriverCell.m
//  TruckUser
//
//  Created by Ting Han on 2017/10/30.
//  Copyright © 2017年 Ting Han. All rights reserved.
//

#import "HTDeliverDriverCell.h"
#import "UIImageView+WebCache.h"

@interface HTDeliverDriverCell()
@property (weak, nonatomic) IBOutlet UIImageView *headImageView;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *caridLabel;
@property (weak, nonatomic) IBOutlet UILabel *lengthLabel;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;

@end

@implementation HTDeliverDriverCell

- (void)setDeliverDetialModel:(HTDeliverDetialModel *)deliverDetialModel{
    _deliverDetialModel = deliverDetialModel;
    self.timeLabel.text = [HTUtils timeIntervalExchange:deliverDetialModel.createtime];
    self.nameLabel.text = deliverDetialModel.name;
    self.caridLabel.text = deliverDetialModel.carnumber;
    self.lengthLabel.text = [NSString stringWithFormat:@"%@米",deliverDetialModel.carlength];
    [self.headImageView sd_setImageWithURL:[NSURL URLWithString:deliverDetialModel.picurl] placeholderImage:[UIImage imageNamed:@"bg_headsculpture"]options:SDWebImageRefreshCached];
}
- (IBAction)didClickCallButton:(id)sender {
   
    NSString *phone = self.deliverDetialModel.phone;
    NSString *str=[[NSMutableString alloc] initWithFormat:@"tel:%@",phone];
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.headImageView.userInteractionEnabled = YES;
    self.headImageView.layer.masksToBounds = YES;
    self.headImageView.layer.cornerRadius = 27.25;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
